package com.miyu.system.controller.sys;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.miyu.system.service.sys.CosDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统dictctol
 * @author MIYU
 * @date 2022/06/04
 */
@RestController
@RequestMapping("/system/dict")
public class CosDictCtol {

    @Autowired
    private CosDictService dictService;

    /**
     * dict类型查询
     *
     * @param param 参数
     * @return {@code JSONArray}
     */
    @RequestMapping("/queryCosDict")
    public JSONArray queryCosDict(@RequestBody  JSONObject param) {
        return dictService.queryCosDict(param);
    }

    /**
     * 编辑系统dict
     *
     * @param param 参数
     * @return {@code JSONObject}
     */
    @RequestMapping("/editCosDict")
    public JSONObject editCosDict(@RequestBody  JSONObject param) {
        return dictService.editCosDict(param);
    }

    /**
     * 删除系统dict
     *
     * @param param 参数
     * @return {@code JSONObject}
     */
    @RequestMapping("/delCosDict")
    public JSONObject delCosDict(@RequestBody  JSONArray param) {
        return dictService.delCosDict(param);
    }


    /**
     * 查询dict列
     *
     * @param param 参数
     * @return {@code JSONArray}
     */
    @RequestMapping("/queryDictColumns")
    public JSONArray queryDictColumns(@RequestBody  JSONObject param) {
        return dictService.queryDictColumns(param);
    }

    /**
     * 得到表数据
     *
     * @param param 参数
     * @return {@code JSONArray}
     */
    @RequestMapping("/getTableData")
    public JSONArray getTableData(@RequestBody  JSONObject param) {
        return dictService.getTableData(param);
    }
}
